<?php

namespace App\Api;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Auth;

class SystemNotiftyController extends Controller
{

    public function index()
    {
        return Auth::user()->unreadNotifications()->get();
    }


    public function show($notify)
    {

        $notification = Auth::user()->notifications()->where('id', $notify)->first();
        $notification->markAsRead();
        return $this->message('通知已阅读');
    }
}
